﻿namespace Microsoft.SharePoint.Client
{
    using System;
    using System.Globalization;
    using System.Xml;

    public class ObjectPathStaticProperty : ObjectPath
    {
        private string m_propertyName;
        private string m_typeId;

        public ObjectPathStaticProperty(ClientRuntimeContext context, string typeId, string propertyName) : base(context, null, true)
        {
            this.m_typeId = typeId;
            this.m_propertyName = propertyName;
        }

        internal override void WriteToXml(XmlWriter writer, SerializationContext serializationContext)
        {
            writer.WriteStartElement("StaticProperty");
            writer.WriteAttributeString("Id", base.Id.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("TypeId", this.m_typeId);
            writer.WriteAttributeString("Name", this.m_propertyName);
            writer.WriteEndElement();
        }
    }
}

